home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / prg_gen / euphor14.zip / MOUSE.E < prev    next >
Text File  |  1996-05-20  |  1KB  |  37 lines

  1.         --------------------
  2.         -- Mouse Routines --
  3.         --------------------
  4. -- You need DOS mouse support for these routines.
  5.  
  6. -- Mouse Event Numbers:
  7. global constant MOVE = 1,       -- track every movement of the mouse
  8.         LEFT_DOWN = 2,  -- the rest are button pressing/releasing
  9.         LEFT_UP = 4,
  10.         RIGHT_DOWN = 8,
  11.         RIGHT_UP = 16,
  12.         MIDDLE_DOWN = 32,
  13.         MIDDLE_UP = 64
  14.  
  15. constant M_GET_MOUSE = 14,
  16.      M_MOUSE_EVENTS = 15,
  17.      M_MOUSE_POINTER = 24
  18.  
  19. global function get_mouse()
  20. -- report mouse events,
  21. -- returns -1 if no mouse event,
  22. -- otherwise returns {event#, x-coord, y-coord}
  23.     return machine_func(M_GET_MOUSE, 0)
  24. end function
  25.  
  26. global procedure mouse_events(integer events)
  27. -- select the mouse events to be reported by get_mouse()
  28. -- e.g. mouse_events(LEFT_UP + LEFT_DOWN + RIGHT_DOWN)
  29.     machine_proc(M_MOUSE_EVENTS, events)
  30. end procedure
  31.  
  32. global procedure mouse_pointer(integer show_it)
  33. -- show (1) or hide (0) the mouse pointer
  34.     machine_proc(M_MOUSE_POINTER, show_it)
  35. end procedure
  36.  
  37.